//
//  SettingViewController.swift
//  newShaohuoRen
//
//  Created by hujinbiao on 2018/3/24.
//  Copyright © 2018年 hujinbiao. All rights reserved.
//

import UIKit

class SettingViewController: UITableViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        self.title = "设置"
    }

    //退出登录
    @IBAction func signOutBtnAction(_ sender: UIButton) {
//        let appDomain = Bundle.main.bundleIdentifier
//        let defats = UserDefaults.standard
//        defats.removePersistentDomain(forName: appDomain!)
        UserTicketModel.sharedInstance.logout()
        let loginVc = LoginController()
        self.present(loginVc, animated: true, completion: nil)
    }
}

extension SettingViewController {
    
    override func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
        return 20
    }
    
    override func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
        return 0.001
    }
    
    override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        if indexPath.section==0 {
            if indexPath.row==0 {
                let board = UIStoryboard(name: "NewSettingController", bundle: nil)
                let Vc = board.instantiateInitialViewController() as! NewSettingController
                navigationController?.pushViewController(Vc, animated: true)
            }
        }else if indexPath.section==1{
            
        }else {
            if indexPath.row==1{
                let board = UIStoryboard(name: "AboutViewController", bundle: nil)
                let Vc = board.instantiateInitialViewController() as! AboutViewController
                navigationController?.pushViewController(Vc, animated: true)
            }
        }
    }
}
